import Vue from 'vue'
import Loading from './loading.vue'

function install(Vue) {
 
    Object.defineProperty(Vue.prototype, '$loading', {
        get() {
            let div = document.createElement('div')
            document.body.appendChild(div);
            return () => {
                const Constructor = Vue.extend(Loading)
                const Instance = new Constructor().$mount(div);
            };
        }
    });
}
 
export default install